//add ct
function addObj(id1,id2,flagNum){
	var divObj=document.getElementById(id1);
	var pObj=divObj.getElementsByTagName("p");
	var pObjOth=document.createElement("p");
	pObjOth.style.padding="0px";
	pObjOth.style.margin="0px";
	pObjOth.id=id2+pObj.length;
	var nowTime=getNowDate();
	var reader = document.getElementById("reader");
	var selectObjText = reader.options[reader.selectedIndex].text;
	var selectObjValue = reader.options[reader.selectedIndex].value;
	if(id2=="ctP"){
		pObjOth.innerHTML="<br/><input type=\"text\" value=\""+selectObjText+"\" readOnly=\"true\"/><input type=\"hidden\" name=\"entity.reader\" value=\""+selectObjValue+"\"/>进入时间：<input type=\"text\" name=\"entity.startTime\" title=\"开始时间\" style=\"width:150px\" class=\"Wdate\" id=\"d414\" onfocus=\"WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})\"/>离开时间：<input type=\"text\" name=\"entity.endTime\" title=\"结束时间\" style=\"width:150px\" class=\"Wdate\" id=\"d414\" onfocus=\"WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})\"/><img src='/SCMDB/images/del.gif' class='delImg' onclick='delLicense(\"ctP"+pObj.length+"\",\"ctDivP\")' title='删除该项' />"
		//alert(pObjOth.innerHTML);
	}
	
	divObj.appendChild(pObjOth);	
}
function getNowDate(){
	var date = new Date(); //日期对象
	var nowTime = "";
	nowTime = date.getFullYear()+"-"; //读英文就行了
	nowTime = nowTime + (date.getMonth()+1)+"-"; //取月的时候取的是当前月-1如果想取当前月+1就可以了
	nowTime = nowTime + date.getDate()+" ";
	nowTime = nowTime + date.getHours()+":";
	nowTime = nowTime + date.getMinutes()+":";
	nowTime = nowTime + date.getSeconds()+"";
	return nowTime;
}


function delLicense(pId,divId){	
	if(!document.getElementById(divId)) return false;
	var divObj=document.getElementById(divId);	
	if(!document.getElementById(pId)) return false;
	var pObj=document.getElementById(pId);	
	divObj.removeChild(pObj);	
}